package com.snowflake.ecatalog.repository;

import java.util.Collection;
import java.util.List;

import org.springframework.data.jpa.repository.JpaSpecificationExecutor;
import org.springframework.data.jpa.repository.Modifying;
import org.springframework.data.jpa.repository.Query;
import org.springframework.data.repository.PagingAndSortingRepository;

import com.snowflake.ecatalog.entity.Profile;

/**
 * 彩页
 */
public interface ProfileDao extends PagingAndSortingRepository<Profile, Long>, JpaSpecificationExecutor<Profile> {
	
	@Modifying
	@Query("update Profile p set p.status = ?1 where p.id=?2")
	void changeStatus(Integer status, Long id);

	List<Profile> findByStatus(int status);

	List<Profile> findByStatusAndIdNotIn(int status, Collection<Long> exludeIdList);
}
